(global.webpackJsonp = global.webpackJsonp || []).push([
  ["wjyk_recycle/pages/auth/auth"], {
    "1e2a": function (e, n, u) {
      (function (o) {
        Object.defineProperty(n, "__esModule", {
          value: !0
        }), n.default = void 0;
        var a = e(u("4795")),
          r = e(u("eeee"));

        function e(e) {
          return e && e.__esModule ? e : {
            default: e
          };
        }

        function i(e, t, n, a, o, r, u) {
          try {
            var c = e[r](u),
              i = c.value;
          } catch (e) {
            return n(e), 0;
          }
          c.done ? t(i) : Promise.resolve(i).then(a, o);
        }
        var t = {
          data: function () {
            return {
              system: {},
              avatarUrl: '',
              nickName: '',
            };
          },
          onShow: function () {},
          onLoad: function () {
            this.systems();
          },
          methods: {

            onChooseAvatar(e) {
              var that = this
              console.log(e)
              const {
                avatarUrl
              } = e.detail
              console.info(that.$api, '_this.api_root')
              console.log('_this.api_root')
              //上传返回网络图片
              // 调用上传接口
              wx.uploadFile({
                url: 'https://xuyihs.axa2.com/app/index.php?i=3&c=entry&a=wxapp&do=upload&m=wjyk_recycle',
                filePath: avatarUrl,
                name: 'file',
                success(res) {
                  console.info(res, '///////////////')
                  // var imgs = JSON.parse(res.data)
                  // console.log(imgs, 'imgs')
                  that.avatarUrl = res.data
                  console.info(that.avatarUrl, 'aabababababa')
                  // that.setData({
                  //   avatarUrl: imgs.data
                  // })

                }
              })
             
            },
            niakname: function (e) {
              console.info(e, '///////////////')
              // console.log(e,'///////////////')
              this.nickName = e.detail.value
              console.info(this.nickName)
              // this.setData({
              //   nickName: e.detail.value
              // })
            },
            // 授权登录 新
            authLogin: function (e) {
              console.info(this.avatarUrl, this.nickName, 'llllllllllllll');
              var a = this;
              if(a.nickName != '' && a.avatarUrl != ''){
                wx.getUserProfile({
                  desc: "用于完善会员资料",
                  success: function (e) {
                    console.info("result", e);
                    var t = e.userInfo,
                      n = o.getStorageSync("pid");
                    console.info("================", e, t), console.info("数据缓存", o.getStorageSync("pid"), n),
                      r.default.getUserInfo(function (e) {
                        r.default.request({
                          url: a.$api.register,
                          method: "GET",
                          data: {
                            pid: n,
                            openid: wx.getStorageSync("openid"),
                            avatar: a.avatarUrl,
                            nickname: a.nickName,
                            unionid: wx.getStorageSync("unionid")
                          },
                          success: function (e) {
                            "request:ok" == e.errMsg && (wx.setStorageSync("uid", e.data.data), wx.navigateBack());
                          },
                          complete: function () {
                            wx.setStorageSync("userInfo", t);
                          },
                          fail: function (e) {
                            console.log("失败", e);
                          }
                        });
                      }, e.detail);
                  }
                });
                
              }else {
                wx.showToast({
                  title: '请选择头像和昵称',
                  icon: 'none',
                  duration: 1000
              });
              }
              
            },
            // 授权登录 旧
            getUserProfile: function (e) {
              var a = this;
              wx.getUserProfile({
                desc: "用于完善会员资料",
                success: function (e) {
                  console.info("result", e);
                  var t = e.userInfo,
                    n = o.getStorageSync("pid");
                  console.info("================", e, t), console.info("数据缓存", o.getStorageSync("pid"), n),
                    r.default.getUserInfo(function (e) {
                      r.default.request({
                        url: a.$api.register,
                        method: "GET",
                        data: {
                          pid: n,
                          openid: wx.getStorageSync("openid"),
                          avatar: t.avatarUrl,
                          nickname: t.nickName,
                          unionid: wx.getStorageSync("unionid")
                        },
                        success: function (e) {
                          "request:ok" == e.errMsg && (wx.setStorageSync("uid", e.data.data), wx.navigateBack());
                        },
                        complete: function () {
                          wx.setStorageSync("userInfo", t);
                        },
                        fail: function (e) {
                          console.log("失败", e);
                        }
                      });
                    }, e.detail);
                }
              });
            },
            handleUnAuth: function () {
              wx.navigateBack();
            },
            updateUserInfo: function (e) {
              var t, n, a = this;
              "getUserInfo:fail auth deny" == e.detail.errMsg ? wx.navigateBack() : (t = e.detail.userInfo,
                n = o.getStorageSync("pid"), console.log("数据缓存", o.getStorageSync("pid"), n), r.default.getUserInfo(function (e) {
                  r.default.request({
                    url: a.$api.register,
                    method: "GET",
                    data: {
                      pid: n,
                      openid: wx.getStorageSync("openid"),
                      avatar: t.avatarUrl,
                      nickname: t.nickName
                    },
                    success: function (e) {
                      "request:ok" == e.errMsg && (wx.setStorageSync("uid", e.data.data), wx.navigateBack());
                    },
                    complete: function () {
                      wx.setStorageSync("userInfo", e.wxInfo);
                    }
                  });
                }, e.detail));
            },
            systems: function () {
              var c, n = this;
              return c = a.default.mark(function e() {
                  var t;
                  return a.default.wrap(function (e) {
                    for (;;) switch (e.prev = e.next) {
                      case 0:
                        return e.next = 2, n.$http({
                          url: n.$api.system
                        });

                      case 2:
                        0 == (t = e.sent).errno && (console.log(t), n.system = t.data);

                      case 4:
                      case "end":
                        return e.stop();
                    }
                  }, e);
                }),
                function () {
                  var e = this,
                    u = arguments;
                  return new Promise(function (t, n) {
                    var a = c.apply(e, u);

                    function o(e) {
                      i(a, t, n, o, r, "next", e);
                    }

                    function r(e) {
                      i(a, t, n, o, r, "throw", e);
                    }
                    o(void 0);
                  });
                }();
            }
          }
        };
        n.default = t;
      }).call(this, u("543d").default);
    },
    "3dd3": function (e, t, n) {
      n.r(t);
      var a, o = n("dd1b"),
        r = n("ddb0");
      for (a in r) "default" !== a && function (e) {
        n.d(t, e, function () {
          return r[e];
        });
      }(a);
      n("a0a5");
      var u = n("f0c5"),
        o = Object(u.a)(r.default, o.b, o.c, !1, null, null, null, !1, o.a, void 0);
      t.default = o.exports;
    },
    a0a5: function (e, t, n) {
      var a = n("e3ea");
      n.n(a).a;
    },
    dd1b: function (e, t, n) {
      function a() {
        this.$createElement, this._self._c;
      }
      var o = [];
      n.d(t, "b", function () {
        return a;
      }), n.d(t, "c", function () {
        return o;
      }), n.d(t, "a", function () {});
    },
    dd58: function (e, t, n) {
      (function (e) {
        function t(e) {
          return e && e.__esModule ? e : {
            default: e
          };
        }
        n("8163"), t(n("66fd")), e(t(n("3dd3")).default);
      }).call(this, n("543d").createPage);
    },
    ddb0: function (e, t, n) {
      n.r(t);
      var a, o = n("1e2a"),
        r = n.n(o);
      for (a in o) "default" !== a && function (e) {
        n.d(t, e, function () {
          return o[e];
        });
      }(a);
      t.default = r.a;
    },
    e3ea: function (e, t, n) {}
  },
  [
    ["dd58", "common/runtime", "common/vendor"]
  ]
]);